package service;

import dao.interfaces.IAlbum;
import dao.interfaces.IPhoto;
import model.Album;
import model.Photo;

import java.io.FileNotFoundException;
import java.sql.SQLException;
import java.util.List;

/**
 * User: Станислав
 * Date: 23.08.14
 */
public class PhotoManager {
    private IAlbum iAlbum;
    private IPhoto iPhoto;

    public PhotoManager(IAlbum iAlbum, IPhoto iPhoto) {
        this.iAlbum = iAlbum;
        this.iPhoto = iPhoto;
    }

    public void AddPhoto(Photo photo, Album album) throws SQLException, FileNotFoundException {
        iAlbum.addAlbum(album);
        iPhoto.addPhoto(photo);
    }

    public void echoRun() {
        iPhoto.echo();
        iAlbum.echo();
    }
    public void addPhoto(Photo photo) throws SQLException {
        iPhoto.addPhoto(photo);
    }
    public void addAlbum(Album album)throws SQLException{
        iAlbum.addAlbum(album);
    }
    public void deletePhoto(Photo photo)throws SQLException{
        iPhoto.deletePhoto(photo);
    }
    public void deleteAlbum(Album album)throws SQLException{
        iAlbum.deleteAlbum(album);
    }
    public List<Photo> getAllPhoto()throws SQLException{
        return iPhoto.getAllPhoto();
    }
    public List<Album> getAllAlbum()throws SQLException{
        return iAlbum.getAllAlbum();
    }
}
